package com.example.sys.org.dao;

import com.example.core.dao.BaseDao;
import com.example.sys.org.po.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface SysUserDao extends BaseDao<SysUser> {

    @Select("select * from sys_user where user_name = #{userName} or id = #{userName}")
    public SysUser getUserByLoginName(@Param("userName") String userName);

    @Select("select * from sys_user where birth_date is null or age = 0")
    public List<SysUser> getUserInfoNeedCalculate();

    @Select("select * from sys_user where wx_id = #{openId} or ding_id = #{openId}")
    public SysUser loadUserByOpenId(@Param("openId") String openId);
}
